﻿<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Modules.OrderSummaryControl"
    CodeBehind="OrderSummary.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="GoogleCheckoutButton" Src="~/Modules/GoogleCheckoutButton.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="OrderTotals" Src="~/Modules/OrderTotals.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="CheckoutAttributes" Src="~/Modules/CheckoutAttributes.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="EstimateShipping" Src="~/Modules/EstimateShipping.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ProductBox1" Src="~/Modules/ProductBox1.ascx" %>

<div style="margin-top: 50px;">
    <asp:Panel class="order-summary-content" runat="server" ID="pnlEmptyCart">
        <%=GetLocaleResourceString("ShoppingCart.CartIsEmpty")%>
    </asp:Panel>
</div>

<asp:Panel class="order-summary-content" runat="server" ID="pnlCart">
    <asp:Panel runat="server" ID="pnlCommonWarnings" CssClass="warning-box" EnableViewState="false"
        Visible="false">
        <asp:Label runat="server" ID="lblCommonWarning" CssClass="warning-text" EnableViewState="false"
            Visible="false"></asp:Label>
    </asp:Panel>

    <div class="order-summary-grid">
        
    <table class="cart" width="100%" border="0" cellspacing="0" cellpadding="5">
        <col width="1" />
        <%if (IsShoppingCart)
          { %>
        <col width="1" />
        <%} %>
        <col width="1" />
        <col width="1" />
        <thead>
            <tr class="cart-header-row">
                <th>
                    Наименование товара
                </th>
                <%if (IsShoppingCart)
                  { %>
                <th>
                    Удалить
                </th>
                <%} %>
                <th>
                    Стоимость
                </th>
                <th>
                    Количество
                </th>
                <th class="end">
                    Сумма
                </th>
            </tr>
        </thead>
        <tbody>
            <asp:Repeater ID="rptShoppingCart" runat="server">
                <ItemTemplate>
                    <tr class="cart-item-row">
                        <td colspan="5">&nbsp;</td>
                    </tr>
                    <tr class="cart-item-row">
                        <td width="200px">
                            <table width="100%" border="0" cellpadding="5" cellspacing="0">
                            <tr>
                                <td class="productpicture">
                                    <asp:Image ID="iProductVariantPicture" runat="server" ImageUrl='<%#GetProductVariantImageUrl((ShoppingCartItem)Container.DataItem)%>'
                                        AlternateText="Product picture" Width="60px" />
                                </td>
                                <td class="product">
                                    <%#GetProductVariantName((ShoppingCartItem)Container.DataItem)%>
                                    <%#GetAttributeDescription((ShoppingCartItem)Container.DataItem)%>
                                    <%#GetRecurringDescription((ShoppingCartItem)Container.DataItem)%>
                                    <asp:Panel runat="server" ID="pnlWarnings" CssClass="warning-box" EnableViewState="false"
                                        Visible="false">
                                        <asp:Label runat="server" ID="lblWarning" CssClass="warning-text" EnableViewState="false"
                                            Visible="false"></asp:Label>
                                    </asp:Panel>
                                </td>
                            </tr>
                            </table>
                        </td>
                        <%if (IsShoppingCart)
                          { %>
                        <td width="90px">
                            <asp:Button runat="server" ID="btnDelete" 
                                OnCommand="btnDelete_Click" OnClientClick="return confirm('Пожалуйста подтвердите удаление');" 
                                CommandArgument='<%# Eval("ShoppingCartItemId") %>'
                                Text="" CausesValidation="false" CssClass="deletefromcartbutton" />
                        </td>
                        <%} %>
                        <td style="white-space: nowrap; width:150px; color: #0069BD;">
                            <%#GetShoppingCartItemUnitPriceString((ShoppingCartItem)Container.DataItem)%>
                        </td>
                        <td style="white-space: nowrap; width:100px;">
                            <%if (IsShoppingCart)
                              { %>
                            <asp:TextBox ID="txtQuantity" size="4" runat="server" Text='<%# Eval("Quantity") %>'
                                SkinID="ShoppingCartQuantityText" />
                            <%}
                              else
                              { %>
                            <asp:Label ID="lblQuantity" runat="server" Text='<%# Eval("Quantity") %>' CssClass="Label" />
                            <%} %>
                        </td>
                        <td style="white-space: nowrap; width:150px; color: #0069BD;">
                            <%#GetShoppingCartItemSubTotalString((ShoppingCartItem)Container.DataItem)%>
                            <asp:Label ID="lblShoppingCartItemId" runat="server" Visible="false" Text='<%# Eval("ShoppingCartItemId") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            <%if (IsShoppingCart)
            { %>
            <tr valign="top" bgcolor="#e0e0e0">
                <td>
                    <asp:Button ID="btnUpdate" OnClick="btnUpdate_Click" runat="server" Text=""
                        CssClass="updatecartbutton" />
                </td>
                
                <td>&nbsp;</td>
                
                <td>&nbsp;</td>
                <td align="center">
                    <span style="color:#0069BD; "><strong>Стоимость</strong></span><br/>
	                  <span style="color:#333333; font-size:10px;">(без учета доставки)</span>
                </td>
                <td align="center">
                    <span style="color:#0069BD; font-weight: bold;">
                        <asp:Label ID="lblSubTotalAmount" runat="server"/>
                    </span>
                </td>
            </tr>
            <%} else {%>
            <tr valign="top" bgcolor="#e0e0e0">
                <td>&nbsp;</td>
                <td align="center">
                    <span style="color:#666; "><strong>Стоимость</strong></span><br/>
	                <span style="color:#0069BD;"><asp:Label ID="lblSumma" runat="server"/></span><br/>
	                <span style="color:#333333; font-size:10px;">(без учета доставки)</span>
                </td>
                <td align="center">
                    <span style="color:#666; "><strong>Доставка</strong></span><br/>
	                <span style="color:#0069BD;"><asp:Label ID="lblDeliveryPrice" runat="server"/></span><br/>
                </td>
                <td align="center">
                    <span style="color:#666; "><strong>Полная стоимость</strong></span><br/>
	                <span style="color:#0069BD;"><asp:Label ID="lblTotalSumma" runat="server"/></span><br/>
                </td>
            </tr>
            <%}%>
        </tbody>
    </table>
    
    <nopCommerce:OrderTotals runat="server" ID="ctrlOrderTotals" Visible="false" />

    </div>

    <%if (this.IsShoppingCart)
    { %>
    <div class="checkout-buttons">
        
            <asp:Button ID="btnContinueShopping" OnClick="btnContinueShopping_Click" runat="server"
                Text="" CssClass="continueshoppingbutton" />
            <asp:Button ID="btnCheckout" OnClick="btnCheckout_Click" runat="server" Text=""
                CssClass="proceedbutton" />
            
        
    </div>        
    <%} %>
    <div class="clear">
    </div>

    <div class="selected-checkout-attributes">
        <%=GetCheckoutAttributeDescription()%>
    </div>

    <div class="clear">
    </div>

    <div class="cart-footer">
        <%if (this.IsShoppingCart)
          { %>
        <asp:PlaceHolder runat="server" ID="phMinOrderSubtotalAmount">
            <div class="min-amount-warning">
                <asp:Label runat="server" ID="lMinOrderSubtotalAmount" />
            </div>
        </asp:PlaceHolder>
        <%} %>
        <div class="clear">
        </div>
        <%if (this.IsShoppingCart)
          { %>
        <nopCommerce:CheckoutAttributes ID="ctrlCheckoutAttributes" runat="server" />
        <div class="clear">
        </div>
        <%} %>
        <div class="totals">
            <%if (this.IsShoppingCart)
              { %>
            <div class="clear">
            </div>
            <%if (this.SettingManager.GetSettingValueBoolean("Checkout.TermsOfServiceEnabled"))
              { %>
            <script language="javascript" type="text/javascript">
                function accepttermsofservice(msg) {
                    if (!document.getElementById('<%=cbTermsOfService.ClientID%>').checked) {
                        alert(msg);
                        return false;
                    }
                    else
                        return true;
                }
            </script>
            <div class="terms-of-service">
                <asp:CheckBox runat="server" ID="cbTermsOfService" />
                <asp:Literal runat="server" ID="lTermsOfService" />
            </div>
            <%} %>
            <div class="clear">
            </div>
            <div class="addon-buttons">
                <nopCommerce:GoogleCheckoutButton runat="server" ID="btnGoogleCheckoutButton"></nopCommerce:GoogleCheckoutButton>
            </div>
            <%} %>
        </div>
        <div class="clear">
        </div>
        <%if (this.IsShoppingCart)
          { %>
        <div class="product-grid">
            <asp:DataList ID="dlCrossSells" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
                RepeatLayout="Table" ItemStyle-CssClass="item-box">
                <HeaderTemplate>
                    <span class="crosssells-title">
                        <%=GetLocaleResourceString("ShoppingCart.CrossSells")%></span>
                </HeaderTemplate>
                <ItemTemplate>
                    <nopCommerce:ProductBox1 ID="ctrlProductBox" Product='<%# Container.DataItem %>'
                        runat="server" RedirectCartAfterAddingProduct="True" />
                </ItemTemplate>
            </asp:DataList>
        </div>
        <div class="clear">
        </div>
        <%} %>
    </div>
</asp:Panel>
